const initValue = {
  cityList: [],
  hotCity: [],
}

export default function cityList(state = initValue, action) {
  const { type, payload } = action
  if (type === 'CITY_LIST') {
    return {
      ...state,
      cityList: payload,
    }
  }
  if (type === 'HOT_CITY') {
    return {
      ...state,
      hotCity: payload,
    }
  }
  return state
}
